package licode.unisop.platform.application.event;

import cn.hutool.json.JSONUtil;
import licode.unisop.platform.client.info.PlatformInfo;
import licode.unisop.types.event.DomainEvent;

public class PlatformAddedEvent extends DomainEvent {
    public PlatformAddedEvent(PlatformInfo data) {
        super(PlatformAddedEvent.class.getTypeName(),
                JSONUtil.toJsonStr(data), "platform:add");
    }

    public PlatformInfo getPlatform() {
        return JSONUtil.toBean(getData(), PlatformInfo.class);
    }
}
